export class WindowService {
  public mini(): Promise<void> {
    return new Promise((resolve, reject) => {
      try {
        global.electronWindow.minimize()
        resolve()
      } catch (e) {
        reject(e)
      }
    })
  }
  public expend(): Promise<void> {
    return new Promise((resolve, reject) => {
      try {
        global.electronWindow.isMaximized() ? global.electronWindow.restore() : global.electronWindow.maximize()
        resolve()
      } catch (e) {
        reject(e)
      }
    })
  }
  public close(): Promise<void> {
    return new Promise((resolve, reject) => {
      try {
        global.electronWindow.close()
        resolve()
      } catch (e) {
        reject(e)
      }
    })
  }
}